import {observable} from 'mobx';
import {Tools} from 'weaver-mobile';
import { ListAdvanced,ListPage } from 'weaver-mobile-page';
import * as API from '../../api/home/pending';

const getLabel = Tools.getLabel;

export default class PendingStore {
    /********************************************************/
    @observable loading = false;
    @observable hasRight = false;

    @observable listAd = new ListAdvanced.Store({ route: '/pending', id: 'advance' });
    @observable upCompingList = new ListPage.Store();

    //获取待办事项
    getUpComingAll = (value={}) =>{
        this.loading = true;
        API.getUpComingAll(value).then( res =>{
            let {status,upCompingList} = res;
            if(status === '1'){
                if(upCompingList){
                    this.upCompingList.setState(upCompingList); 
                }else{
                    this.upCompingList = new ListPage.Store();
                }
               
                
            }else{
                console.log('异常')
            }
            
            this.loading = false;
        }) 
    }


}
